
#ifndef MouseAndCat_Slave_h
#define MouseAndCat_Slave_h

#include "Messenger.h"
#include "MncPoint.h"

class Slave
{
public:
    
    enum Xentry
    {
        left    = 1,
        right   = 2
    };
    
    Slave(std::string remote_ip, int port, MncPoint screen_size);
    ~Slave();
    void Start();
    void Stop();
    
protected:

	virtual MncPoint GetMouseLocation();
    virtual void EnactMouseEvent(abyte, MncPoint, abyte) = 0;

private:
    
    Messenger* messenger_;
    bool be_slave_;
    Xentry x_entry_;
    MncPoint screen_size_;
    
    Slave();
    void Process(Message*);
    virtual void HandleMouseEntered(Message*);
    bool MouseIsLeaving(MncPoint*);
};

class Slave2 : public Slave
{
};

#endif